package com.lemobar.pay.model.wxpay.response;

import lombok.Data;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

/**
 * 微信统一下单 同步返回参数
 * JSAPI支付 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1
 * 微信小程序支付 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_1
 * APP支付 https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_1
 */
@Data
@Root(name = "xml", strict = false)
public class WxPayUnifiedCreateResponse {

    /**
     * 返回状态码
     */
    @Element(name = "return_code")
    private String returnCode;

    /**
     * 返回信息
     */
    @Element(name = "return_msg", required = false)
    private String returnMsg;

    /**
     * 以下字段在return_code为SUCCESS的时候有返回. ***********************************
     */

    /**
     * 公众账号ID
     */
    @Element(name = "appid", required = false)
    private String appid;

    /**
     * 商户号
     */
    @Element(name = "mch_id", required = false)
    private String mchId;

    /**
     * 设备号
     */
    @Element(name = "device_info", required = false)
    private String deviceInfo;

    /**
     * 随机字符串
     */
    @Element(name = "nonce_str", required = false)
    private String nonceStr;

    /**
     * 签名
     */
    @Element(name = "sign", required = false)
    private String sign;

    /**
     * 业务结果	 SUCCESS/FAIL
     */
    @Element(name = "result_code", required = false)
    private String resultCode;

    /**
     * 错误代码
     */
    @Element(name = "err_code", required = false)
    private String errCode;

    /**
     * 错误代码描述
     */
    @Element(name = "err_code_des", required = false)
    private String errCodeDes;


    @Element(name = "partner_trade_no", required = false)
    private String partnerTradeNo;

    @Element(name = "amount", required = false)
    private Integer amount;

    /**
     * 以下字段在return_code 和 result_code都为SUCCESS的时候有返回. **************************
     */

    /**
     * 交易类型
     */
    @Element(name = "trade_type", required = false)
    private String tradeType;

    /**
     * 预支付交易会话标识
     */
    @Element(name = "prepay_id", required = false)
    private String prepayId;


    @Element(name = "code_url", required = false)
    private String codeUrl;

    @Element(name = "mweb_url", required = false)
    private String mwebUrl;

    @Element(name = "payment_no", required = false)
    private String paymentNo;

    @Element(name = "cmms_amt", required = false)
    private Integer cmmsAmt;
}
